package org.example.system.common.enums;
//车辆状态(0:空闲中 1:已预订 2:已出租 3:维修中 4：已报废)
public enum VehicleStatusEnum {
    IDLE(0,"空闲中"),
    RESERVED(1,"已预订"),
    RENTED(2,"已出租"),
    REPAIRING(3,"维修中"),
    SCRAPPED(4,"已报废");

    private Integer code;
    private String desc;

    VehicleStatusEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public Integer getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public static String getEnumByCode(Integer code) {
        for (VehicleStatusEnum e : VehicleStatusEnum.values()) {
            if (e.getCode().equals(code)) {
                return e.desc;
            }
        }
        return null;
    }


}
